package com.holystone.orca.sys.model;

import java.util.Objects;

/**
 * Copyright (c) 2015, HOLYSTONE Technologies, Inc.
 * All right reserved.
 *
 * @desc:
 * @author:fengt
 * @date:15/12/5
 * @Time:上午11:20
 */
public class TreeVo {
    private Integer id;
    private Integer pId;
    private String name;
    private boolean open;
    private boolean checked;



    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public TreeVo(Integer id, Integer pId, String name, boolean open) {
        this.id = id;
        this.pId = pId;
        this.name = name;
        this.open = open;
    }

    public TreeVo(Integer id, Integer pId, String name, boolean open, boolean checked) {
        this.id = id;
        this.pId = pId;
        this.name = name;
        this.open = open;
        this.checked = checked;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public boolean isOpen() {
        return open;
    }

    public void setOpen(boolean open) {
        this.open = open;
    }

    public Integer getpId() {
        return pId;
    }

    public void setpId(Integer pId) {
        this.pId = pId;
    }

    @Override
    public String toString() {
        return "TreeVo{" +
                "id=" + id +
                ", pId=" + pId +
                ", name='" + name + '\'' +
                ", open=" + open +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TreeVo treeVo = (TreeVo) o;
        return Objects.equals(id, treeVo.id);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id);
    }

    public boolean isChecked() {
        return checked;
    }

    public void setChecked(boolean checked) {
        this.checked = checked;
    }
}
